﻿using System.Collections.Generic;
using SuiHan.Commons.Daemon;
using SuiHan.Commons.Daemon.Util;
using SuiHan.Commons.Logging;

namespace SuiHan.Daemons.Shutdown {
    internal class Program {
        public static void Main(string[] args) {
            LoggerFactory.Config(new LoggerConfig { ConsoleEnabled = true, Level = LoggerLevel.DEBUG, FileEnabled = false });

            List<DaemonProcess> daemons = DaemonUtils.LoadDaemons();
            if (daemons.Count > 0) {
                daemons.ForEach(it => {
                    if (it.Killable) {
                        it.KillProcess();
                    }
                });
            }
        }
    }
}
